home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Encyclopedia / Multimedia Encyclopedia 1.bin / stw.inf < prev    next >
INI File  |  1992-12-04  |  7KB  |  239 lines

  1. ;; This is the installation script Software Toolworks for Windows 
  2. DefineVariables
  3. Text     [Title] := The Software Toolworks Multimedia Encyclopedia
  4. Text     [InitFile]     := STW.INI
  5. Text     [BackgroundBitmap] := stw.bmp
  6. Text     [AppName]      := STW
  7. Text     [AppExe]       := stw.exe
  8. Text     [AppHelp]      := stw.hlp
  9. Text     [UserVersion]
  10. Text     [NewVersion]
  11. EndDefineVariables
  12.  
  13. [Number8] := 0
  14.  
  15. Do SetupGro
  16.  
  17. ;;  LoadBitMap 1 [InstallFromDirectory]\[BackgroundBitmap] @xy(5,5)
  18. ;;  ShowBitMap 1
  19.   ShowWindow Maximized
  20.  
  21. Dialog
  22.   .cThanks for purchasing [Title]
  23. EndDialog
  24.  
  25. [Point1]
  26.  
  27. GetMenuChoice
  28.   Install [Title]
  29.     ; Use this choice initially for a
  30.     ; complete installation.
  31.   Finished
  32.     ; Exit this installation process
  33. EndGetMenuChoice
  34.  
  35. InCase Choice is
  36.   =1:  Do Install
  37.   =2:  Do ByeBye
  38. EndInCase
  39.  
  40. Procedure Install
  41.  
  42.   [InstallationDirectory] := C:\STW_WIN
  43.   
  44.   Dialog [InstallationDirectory] 44
  45.     Please indicate the drive and directory where the
  46.     encyclopedia should be installed.
  47.   EndDialog
  48.   
  49.   CreateDirectoryIfNecessary [InstallationDirectory]
  50.   ChangeDirectoryTo [InstallationDirectory]
  51.  
  52.   CopyFiles from [InstallFromDirectory] to [InstallationDirectory]
  53.    [AppExe] 
  54.    [InitFile]
  55.    [AppHelp]
  56.    eesc.dll
  57.   EndCopyFiles
  58.  
  59.    SetFileAttrTo 00 for [InstallationDirectory]\[AppExe]
  60.    SetFileAttrTo 00 for [InstallationDirectory]\[InitFile]
  61.    SetFileAttrTo 00 for [InstallationDirectory]\[AppHelp]
  62.    SetFileAttrTo 00 for [InstallationDirectory]\eesc.dll
  63.  
  64.   if FileExists [WindowsSystemDirectory]\ver.dll
  65.   else
  66.     CopyFiles from [InstallFromDirectory] to [WindowsSystemDirectory]
  67.           VER.DLL
  68.     EndCopyFiles
  69.     SetFileAttrTo 00 for [WindowsSystemDirectory]\ver.dll
  70.   Endif
  71.  
  72.   CopyFiles from [InstallFromDirectory] to [WindowsSystemDirectory]
  73.    AAPLAY.DLL
  74.   EndCopyFiles
  75.   SetFileAttrTo 00 for [WindowsSystemDirectory]\aaplay.dll
  76.  
  77.   if FileExists [WindowsSystemDirectory]\commdlg.dll
  78.      [UserVersion] := ProductVersion [WindowsSystemDirectory]\commdlg.dll
  79.      [NewVersion] := ProductVersion [InstallFromDirectory]\commdlg.dll
  80.      if UserVersion < NewVersion
  81.        CopyFiles from [InstallFromDirectory] to [WindowsSystemDirectory]
  82.           COMMDLG.DLL
  83.        EndCopyFiles
  84.        SetFileAttrTo 00 for [WindowsSystemDirectory]\commdlg.dll
  85.      Endif
  86.   else
  87.      CopyFiles from [InstallFromDirectory] to [WindowsSystemDirectory]
  88.         COMMDLG.DLL
  89.      EndCopyFiles
  90.      SetFileAttrTo 00 for [WindowsSystemDirectory]\commdlg.dll
  91.   Endif
  92.  
  93.   if FileExists [WindowsSystemDirectory]\shell.dll
  94.      [UserVersion] := ProductVersion [WindowsSystemDirectory]\shell.dll
  95.      [NewVersion] := ProductVersion [InstallFromDirectory]\shell.dll
  96.      if UserVersion < NewVersion
  97.        CopyFiles from [InstallFromDirectory] to [WindowsSystemDirectory]
  98.           SHELL.DLL
  99.        EndCopyFiles
  100.        SetFileAttrTo 00 for [WindowsSystemDirectory]\shell.dll
  101.      Endif
  102.   else
  103.      CopyFiles from [InstallFromDirectory] to [WindowsSystemDirectory]
  104.         SHELL.DLL
  105.      EndCopyFiles
  106.      SetFileAttrTo 00 for [WindowsSystemDirectory]\shell.dll
  107.   Endif
  108.  
  109.     ;; Setup win.ini file with the approriate startup directory
  110.    [Array1][1] := [AppName]
  111.    [Array1][2] := dir
  112.    [Array1][3] := [InstallationDirectory]
  113.    WriteProfileString Using [Array1]
  114.  
  115.   Dialog [InstallFromDrive] 1
  116.     Please indicate the drive letter of the CD-ROM
  117.     drive where the encyclopedia will be located.
  118.   EndDialog
  119.   
  120.     ;; Setup disk to get database from
  121.    [Array1][1] := Database
  122.    [Array1][2] := Disk
  123.    [Array1][3] := [InstallFromDrive]
  124.    [Array1][4] := [InstallationDirectory]\[InitFile]
  125.    WritePrivateProfileString Using [Array1]
  126.  
  127.     ;; Setup help directory
  128.    [Array1][1] := Database
  129.    [Array1][2] := Help
  130.    [Array1][3] := [InstallationDirectory]\[AppHelp]
  131.    [Array1][4] := [InstallationDirectory]\[InitFile]
  132.    WritePrivateProfileString Using [Array1]
  133.  
  134.     ;; Setup notes directory
  135.    [Array1][1] := Database
  136.    [Array1][2] := Notes
  137.    [Array1][3] := [InstallationDirectory]
  138.    [Array1][4] := [InstallationDirectory]\[InitFile]
  139.    WritePrivateProfileString Using [Array1]
  140.  
  141.  
  142.    Dialog [YesOrNo1]
  143.     Do you have a Windows-supported sound card installed
  144.     in your computer?
  145.    EndDialog
  146.     [Number9] := 0
  147.    if [YesOrNo1] = YesCharacter
  148.        Dialog [YesOrNo2]
  149.        Do you want [Title] to use the card?
  150.        EndDialog
  151.     if [YesOrNo2] = NoCharacter
  152.         [Number9] := 0
  153.     else
  154.         [Number9] := 1
  155.     Endif
  156.    Endif
  157.    if [Number9] = 0
  158.        [Array1][1] := Database
  159.        [Array1][2] := RedBook
  160.        [Array1][3] := 1
  161.        [Array1][4] := [InstallationDirectory]\[InitFile]
  162.        WritePrivateProfileString Using [Array1]
  163.    Endif
  164.  
  165.    ;; Install Video Stuff
  166.    if WindowsVersion < 3.1
  167.        Dialog
  168.        Video is not supported for your Windows version.
  169.        EndDialog
  170.    else
  171.        Dialog
  172.        Microsoft Video for Windows will now be installed.
  173.        EndDialog
  174.        Run [InstallFromDirectory]\MSVIDEO\setup.exe
  175.    Endif
  176.  
  177.  
  178.     ;; Setup Group file
  179.    Dialog [YesOrNo1]
  180.     Would you like to build a [AppName] program group?
  181.    EndDialog
  182.    if [YesOrNo1] = YesCharacter
  183.       [Array1][1] := [InstallationDirectory]\[AppExe]
  184.       BuildProgramGroup "STW" stw.grp
  185.         [Array1][1] "Software Toolworks Encyclopedia" [Array1][1]
  186.       EndBuildProgramGroup
  187.    Endif
  188.  
  189.   [Number8] := 1
  190.  
  191.   Do ByeBye
  192.  
  193. EndProcedure
  194.  
  195. Procedure ByeBye
  196.   if [Number8] = 1
  197.   else
  198.      Popup [Title] was not successfully installed
  199.   Endif
  200.    
  201.   Dialog PressAKey WhiteOnBrown
  202.     Thank You for Purchasing [Title]
  203.   EndDialog
  204.   SoLong
  205. EndProcedure
  206.  
  207.  
  208. Procedure SetupGro
  209.   SetTopLineTo Installing [Title] (Press Esc to exit)
  210.  
  211.    [Number1] := 320 - 130 + 40
  212.    [Number2] := 15
  213.    [Number3] := 320 + 130 + 40
  214.    [Number4] := 65
  215.    [Number5] := 320 - 130 + 50
  216.    [Number6] := 32
  217.    [Number7] := 700000
  218.    [String1] := ShadowDirectory
  219.  
  220.   ;; While it is not documented anywhere else it is true that FreeSpaceOnDrive
  221.   ;; considers only the first character of its first parameter (in this case
  222.   ;; the drive letter of the temporary directory).
  223.   If FreeSpaceOnDrive ShadowDirectory < 25000
  224.    popup There is insufficient space on the TEMP drive for installation.
  225.    SoLong
  226.   EndIf
  227.  
  228.  
  229. ;;  Ellipse @xy([Number1],[Number2]) @xy([Number3],[Number4])
  230. ;;  TextOut @xy([Number5],[Number6]) Welcome to [AppName] installation!
  231.   SetDefaultBitmap off
  232.   SetBackgroundColor 0 0 255 0 0 0 TopToBottom
  233.   ShowWindow Maximized
  234.  
  235. EndProcedure
  236.  
  237. EndScript
  238. 
  239.